//NewCome/User
/**
 * 用户
 * 
 * @package NewCome\Object
 */
define('User',
    ['avalon'],
    function () {
        var obj={      
            obj:{
UID:'',//用户编号  int(11) 必填:1 默认值:,
            Account:'',//账户  char(50) 必填:1 默认值:,
            PWD:'',//密码  char(50) 必填:1 默认值:,
            Email:'',//电子邮箱  char(50) 必填:1 默认值:,
            Role:'',//角色  tinyint(1) 必填:1 默认值:,
            CTime:'',//注册时间  int 必填:1 默认值:
},
            
check: function (Module,Class,Action,Layer,UID,success,error) {
                $$.call({
                    i:"NewCome/User/check",
                    data:{
                        Module:Module,
Class:Class,
Action:Action,
Layer:Layer,
UID:UID
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
loginByOpenID: function (OpenID,success,error) {
                $$.call({
                    i:"NewCome/User/loginByOpenID",
                    data:{
                        OpenID:OpenID
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
saveW: function (W,Data,success,error) {
                $$.call({
                    i:"NewCome/User/saveW",
                    data:{
                        W:W,
Data:Data
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
reg: function (Account,PWD,Properties,success,error) {
                $$.call({
                    i:"NewCome/User/reg",
                    data:{
                        Account:Account,
PWD:PWD,
Properties:Properties
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
login: function (Account,PWD,success,error) {
                $$.call({
                    i:"NewCome/User/login",
                    data:{
                        Account:Account,
PWD:PWD
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
logout: function (success,error) {
                $$.call({
                    i:"NewCome/User/logout",
                    data:{
                        
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
findAccount: function (Account,success,error) {
                $$.call({
                    i:"NewCome/User/findAccount",
                    data:{
                        Account:Account
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
resetPWD: function (UID,PWD,Code,Account,success,error) {
                $$.call({
                    i:"NewCome/User/resetPWD",
                    data:{
                        UID:UID,
PWD:PWD,
Code:Code,
Account:Account
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
checkAccount: function (Account,success,error) {
                $$.call({
                    i:"NewCome/User/checkAccount",
                    data:{
                        Account:Account
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
reLogin: function (SID,success,error) {
                $$.call({
                    i:"NewCome/User/reLogin",
                    data:{
                        SID:SID
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
sendVerify: function (UID,Account,Type,success,error) {
                $$.call({
                    i:"NewCome/User/sendVerify",
                    data:{
                        UID:UID,
Account:Account,
Type:Type
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            


loginByCode: function (Account,Code,success,error) {
                $$.call({
                    i:"NewCome/User/loginByCode",
                    data:{
                        Account:Account,
Code:Code
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
get: function (UID,success,error) {
                $$.call({
                    i:"NewCome/User/get",
                    data:{
                        UID:UID
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
gets: function (UIDs,success,error) {
                $$.call({
                    i:"NewCome/User/gets",
                    data:{
                        "NewCome/User":UIDs,
                        "P":1,
                        "N":1000000
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
save: function (UID,Params,success,error) {
                $$.call({
                    i:'NewCome/User/save',
                    data:{
                        UID:UID,
                        Params:Params
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
del: function (UID,success,error) {
                $$.call({
                    i:"NewCome/User/del",
                    data:{
                        "UID":UID
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
search: function (data,success,error) {
                $$.call({
                    i:"NewCome/User/search",
                    data:data,
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
add: function (data,success,error) {
                $$.call({
                    i:'NewCome/User/add',
                    data:data,
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
adds: function (data,Replace,success,error) {
                $$.call({
                    i:"NewCome/User/adds",
                    data:{
                        data:data,
Replace:Replace
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            /**
     * 条件置换
     * @param W
     * @param Data
     * @return |mixed|
     */
replaceW: function (W,Data,success,error) {
                $$.call({
                    i:"NewCome/User/replaceW",
                    data:{
                        W:W,
Data:Data
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            },
            
report: function (Name,Params,P,N,R,success,error) {
                $$.call({
                    i:"NewCome/User/report",
                    data:{
                        Name:Name,
Params:Params,
P:P,
N:N,
R:R
                    },
                    success:success?success:function () {},
                    error:error?error:function (err) {tip.on(err)}
                })
            }
        }
        return window['obj_NewCome_User']=obj
    })